package com.springboot.autoconfigure.oss.model;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * oss文件上传换回对象
 */
@Data
@Builder
public class FileUploadStatus {
    /**
     * 上传是否成功
     */
    private boolean success;
    /**
     * 直接访问的url
     */
    private String url;
    /**
     *
     */
    private String fileName;
    /**
     *地址是否可以直接访问
     */
    private boolean urlIsPublic;
    /**
     * 文件key
     */
    private String fileKey;
    /**
     * 文件扩展名
     */
    private String fileExt;
    /**
     * 扩展信息
     */
    private Map<String,Object> otherInfo;

    private String errorMsg;

    public static FileUploadStatus suceess(){
        return  FileUploadStatus.builder().success(true).build();
    }

    public static FileUploadStatus fail(){
        return  FileUploadStatus.builder().success(false).build();
    }
}
